#!/bin/bash
echo "--------------------------------------1. build tool  --------------------------------------"
# 获取当前脚本所在路径
BASEPATH=$(cd "$(dirname $0)" || exit; pwd)
echo  $BASEPATH

mkdir -p build
mkdir -p bin
mkdir -p lib
cd build

rm -rf *
echo "--------------------------------------2. cmake & make--------------------------------------"

# 定义参数列表
CMAKE_OPTIONS=(
    "-DHOME=${BASEPATH}"
    # "-DCMAKE_TOOLCHAIN_FILE=${BASEPATH}/toolchain.cmake" # 交叉编译工具里
)
cmake "${CMAKE_OPTIONS[@]}" ..

make

# 返回到脚本所在目录
cd ${BASEPATH} || exit